import javax.print.attribute.standard.PrinterMessageFromOperator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-03-12
 * Time: 18:33
 */

class Goble implements Runnable{
    @Override
    public void run() {
        while(true) {
            System.out.println("好耶 ^v^");
            System.out.println(Thread.currentThread().isAlive());
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

public class Test3 {


    public static void main1(String[] args) {
        Thread t = new Thread(new Goble(), "哈喽哈喽我是另一个线程"); //传一个工具过去
        System.out.println(t.isAlive());
        t.start();
        while(true) {
            System.out.println("不好耶T.T");
            try {
                System.out.println(t.isAlive());
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
